package edu.pku.sei.transformation.editor.parser.texttemplate.element;

import edu.pku.sei.transformation.editor.model.variable.ConnectionVariable;


public class ElementEdge extends ConnectionVariable implements Comparable{
	private TextElement target;
	private TextElement source;
	private int weight = 1;
	public TextElement getSourceTextElement() {
		return source;
	}
//	public void setSource(TextElement source) {
//		this.source = source;
//	}

	public TextElement getTargetTextElement() {
		return target;
	}
//	public void setTarget(TextElement to) {
//		this.target = to;
//	}
	public int getWeight() {
		return weight;
	}
	public void setWeight(int weight) {
		this.weight = weight;
	}
	
	@Override
	public String toString() {
		return weight +"." + target.getName();
	}
	@Override
	public int compareTo(Object arg0) {
		if (arg0 instanceof ElementEdge)
			return this.weight - ((ElementEdge)arg0).getWeight();
		else
			return 0;
	}
}
